#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using webapp4U.DAL;
#endregion


namespace webapp4U.BOL
{
	 public class Logo : BizObject
	 {
	     #region Member Variables

	     private Int32 _logoID;

	     private String _fileName;

	     private String _uRL;

	     private DateTime _regionDate;

	     private DateTime _expireDate;

	     private Int32 _cateID;

	     private Int32 _position;

	     private Int32 _displayOrder;

	     private DateTime _addedDate;

	     private Boolean _isActive;

	     #endregion


	     #region Public Properties

	     public Int32 LogoID
	     {
		     get { return _logoID; }
		     set { _logoID = value; }
	     }

	     public String FileName
	     {
		     get { return _fileName; }
		     set { _fileName = value; }
	     }

	     public String URL
	     {
		     get { return _uRL; }
		     set { _uRL = value; }
	     }

	     public DateTime RegionDate
	     {
		     get { return _regionDate; }
		     set { _regionDate = value; }
	     }

	     public DateTime ExpireDate
	     {
		     get { return _expireDate; }
		     set { _expireDate = value; }
	     }

	     public Int32 CateID
	     {
		     get { return _cateID; }
		     set { _cateID = value; }
	     }

	     public Int32 Position
	     {
		     get { return _position; }
		     set { _position = value; }
	     }

	     public Int32 DisplayOrder
	     {
		     get { return _displayOrder; }
		     set { _displayOrder = value; }
	     }

	     public DateTime AddedDate
	     {
		     get { return _addedDate; }
		     set { _addedDate = value; }
	     }

	     public Boolean IsActive
	     {
		     get { return _isActive; }
		     set { _isActive = value; }
	     }

	     #endregion

	     #region public static Methods

         public static List<Logo> GetLogoByPosition(Int32 Position)
         {
             LogoDAL db = new LogoDAL();
             return db.GetLogoByPosition(Position);
         }

	     public static int Insert(Logo obj)
	     {
		     LogoDAL db = new LogoDAL();
		     return db.Insert(obj);
	     }

	     public static bool Update(Logo obj)
	     {
		     LogoDAL db = new LogoDAL();
		     return db.Update(obj);
	     }

	     public static bool Delete(Int32 LogoID)
	     {
             Logo obj = Logo.GetLogoByID(LogoID);
             FileProcess.DeleteFile(Globals.PhysicalApplicationPath() + "UserUpload/Link/" + obj.FileName);
		     LogoDAL db = new LogoDAL();
		     return db.Delete(LogoID); 
	     }

	     public static Logo GetLogoByID(Int32 LogoID)
	     {
		     LogoDAL db = new LogoDAL();
		     return db.GetLogoByID(LogoID);
	     }

         //Get All Logo
         public static List<Logo> GetAllLogo()
         {
             LogoDAL db = new LogoDAL();
             return db.GetAllLogo(1, MAXROWS);
         }


	     //Get All Logo
	     public static List<Logo> GetAllLogo(int PageIndex, int PageSize)
	     {
		     LogoDAL db = new LogoDAL();
		     return db.GetAllLogo(PageIndex, PageSize);
	     }

	     // Get Count All records of Table  Logo
	     public static int GetCountLogo()
	     {
		     LogoDAL db = new LogoDAL();
		     return db.GetCountLogo();
	     }


	     // Get LogoByCateID
	     public static List<Logo> GetLogoByCateID(Int32 CateID,int PageIndex, int PageSize)
	     {
		     LogoDAL db = new LogoDAL();
		     return db.GetLogoByCateID(CateID, PageIndex, PageSize);
	     }

	     // Get LogoCountByCateID
	     public static int GetLogoCountByCateID(Int32 CateID)
	     {
		     LogoDAL db = new LogoDAL();
		     return db.GetLogoCountByCateID(CateID);
	     }

	     #endregion
	 }
}
